package com.xindaoapp.framework.activity;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

import com.xindaoapp.framework.R;

public class BaseActivity extends Activity {
	private ImageButton left;
	private ImageButton right;
	public void setTitle(String tContent) {
		((TextView) this.findViewById(R.id.title)).setText(tContent);
	}
	public void setRightButton(Drawable draw,OnClickListener onClickListener) {
		right = (ImageButton) findViewById(R.id.right);
		right.setBackgroundDrawable(draw);
		right.setVisibility(View.VISIBLE);
		right.setOnClickListener(onClickListener);
	}
	@Override
	public void setContentView(int layoutResID) {
		super.setContentView(layoutResID);
		left = (ImageButton) findViewById(R.id.left);
		left.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}
}
